package icu.lookyousmileface.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author starrysky
 * @title: PageController
 * @projectName spring_secretary
 * @description: controller layer
 * @date 2021/2/1013:52
 */
@Controller
public class PageController {
    @GetMapping({"/", "/index"})
    public String index() {
        return "index";
    }

    @GetMapping("/toLogin")
    public String toLogin() {
        return "views/login";
    }

    @GetMapping("/{level}/{id}")
    public String toView(@PathVariable("level") String level, @PathVariable("id") Integer id) {
        return "views/level" + level.charAt(level.length() - 1) + "/" + id;
    }

}
